using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using Bussiness.Config;     
using Bussiness.Entity;
namespace Bussiness.ManagerBase
{
                

     public abstract class CmsPartnersManagerBase
    {
        public CmsPartnersManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>CmsPartnersEntity</returns>
        public CmsPartnersEntity Insert(CmsPartnersEntity obj)
        { 
            return (CmsPartnersEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>CmsPartnersEntity</returns>
        public CmsPartnersEntity Update(CmsPartnersEntity obj)
        { 
            return (CmsPartnersEntity)Adapter.Update(obj);             
        }
 
 
        public CmsPartnersEntity Delete(CmsPartnersEntity obj)
        { 
            return (CmsPartnersEntity)Adapter.Delete(obj);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>CmsPartnersEntity</returns>
        public CmsPartnersEntity DeleteById (CmsPartnersEntity obj)
        { 
            return (CmsPartnersEntity)Adapter.DeleteByField(obj,"Id");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Id 
        /// </summary>
        /// <returns>CmsPartnersEntity</returns>
        public CmsPartnersEntity DeleteById (Guid Id )
        { 
            CmsPartnersEntity obj = new CmsPartnersEntity();
            obj.Id = Id;  
            return (CmsPartnersEntity)Adapter.DeleteByField(obj,"Id");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Photo duoc set trong object
        /// </summary>
        /// <returns>CmsPartnersEntity</returns>
        public CmsPartnersEntity DeleteByPhoto (CmsPartnersEntity obj)
        { 
            return (CmsPartnersEntity)Adapter.DeleteByField(obj,"Photo");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Photo 
        /// </summary>
        /// <returns>CmsPartnersEntity</returns>
        public CmsPartnersEntity DeleteByPhoto (string Photo )
        { 
            CmsPartnersEntity obj = new CmsPartnersEntity();
            obj.Photo = Photo;  
            return (CmsPartnersEntity)Adapter.DeleteByField(obj,"Photo");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public CmsPartnersEntity Select(CmsPartnersEntity obj)
        { 
            return (CmsPartnersEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(CmsPartnersEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(CmsPartnersEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new CmsPartnersEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new CmsPartnersEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<CmsPartnersEntity> SelectAllLST()
        { 
            return  (List<CmsPartnersEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new CmsPartnersEntity()),new CmsPartnersEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<CmsPartnersEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<CmsPartnersEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new CmsPartnersEntity(),option),new CmsPartnersEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (CmsPartnersEntity obj)
        { 
            return Adapter.SelectByField(obj,"Id");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (CmsPartnersEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"Id",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>List<CmsPartnersEntity></returns>
        public List<CmsPartnersEntity> SelectByIdLST (CmsPartnersEntity obj)
        { 
            return  (List<CmsPartnersEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id"),new CmsPartnersEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>List<CmsPartnersEntity></returns>
        public List<CmsPartnersEntity> SelectByIdLST (CmsPartnersEntity obj,SelectOptions option)
        { 
            return  (List<CmsPartnersEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"Id",option),new CmsPartnersEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (Guid Id )
        { 
            CmsPartnersEntity obj = new CmsPartnersEntity();
            obj.Id = Id;  
            return Adapter.SelectByField(obj,"Id");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (Guid Id, SelectOptions option)
        { 
            CmsPartnersEntity obj = new CmsPartnersEntity();
            obj.Id = Id;  
            return Adapter.SelectByField(obj,"Id",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsPartnersEntity> SelectByIdLST (Guid Id )
        { 
            CmsPartnersEntity obj = new CmsPartnersEntity();
            obj.Id = Id;  
            return  (List<CmsPartnersEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id"),new CmsPartnersEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsPartnersEntity> SelectByIdLST (Guid Id, SelectOptions option)
        { 
            CmsPartnersEntity obj = new CmsPartnersEntity();
            obj.Id = Id;  
            return  (List<CmsPartnersEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id",option),new CmsPartnersEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Photo duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByPhoto (CmsPartnersEntity obj)
        { 
            return Adapter.SelectByField(obj,"Photo");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Photo duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByPhoto (CmsPartnersEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"Photo",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Photo duoc set trong object
        /// </summary>
        /// <returns>List<CmsPartnersEntity></returns>
        public List<CmsPartnersEntity> SelectByPhotoLST (CmsPartnersEntity obj)
        { 
            return  (List<CmsPartnersEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Photo"),new CmsPartnersEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Photo duoc set trong object
        /// </summary>
        /// <returns>List<CmsPartnersEntity></returns>
        public List<CmsPartnersEntity> SelectByPhotoLST (CmsPartnersEntity obj,SelectOptions option)
        { 
            return  (List<CmsPartnersEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"Photo",option),new CmsPartnersEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Photo 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByPhoto (string Photo )
        { 
            CmsPartnersEntity obj = new CmsPartnersEntity();
            obj.Photo = Photo;  
            return Adapter.SelectByField(obj,"Photo");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Photo duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByPhoto (string Photo, SelectOptions option)
        { 
            CmsPartnersEntity obj = new CmsPartnersEntity();
            obj.Photo = Photo;  
            return Adapter.SelectByField(obj,"Photo",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Photo 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsPartnersEntity> SelectByPhotoLST (string Photo )
        { 
            CmsPartnersEntity obj = new CmsPartnersEntity();
            obj.Photo = Photo;  
            return  (List<CmsPartnersEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Photo"),new CmsPartnersEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Photo duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsPartnersEntity> SelectByPhotoLST (string Photo, SelectOptions option)
        { 
            CmsPartnersEntity obj = new CmsPartnersEntity();
            obj.Photo = Photo;  
            return  (List<CmsPartnersEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Photo",option),new CmsPartnersEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<CmsPartnersEntity></returns>
        public List<CmsPartnersEntity> SelectWithConditionLST (CmsPartnersEntity obj)
        { 
            return  (List<CmsPartnersEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new CmsPartnersEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<CmsPartnersEntity></returns>
        public List<CmsPartnersEntity> SelectWithConditionLST (CmsPartnersEntity obj,SelectOptions option)
        { 
            return  (List<CmsPartnersEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new CmsPartnersEntity());
        }

}
}
